package br.com.leilao.managebean;

import java.io.Serializable;
import java.util.ArrayList;

import org.primefaces.util.ArrayUtils;

public abstract class ManageBeanGeneric<T> implements Serializable{
	private static final long serialVersionUID = 1L;
	private T bean;
	private ArrayList<T> lista;
	
	public ManageBeanGeneric(Class<T> clazz) {
		try {
			setBean(clazz.newInstance());
			this.setLista(new ArrayList<T>());
		} catch (Exception e) {
			e.printStackTrace();
		}  
	}

	public T getBean() {
		return bean;
	}

	public void setBean(T bean) {
		this.bean = bean;
	}

	public ArrayList<T> getLista() {
		return lista;
	}

	public void setLista(ArrayList<T> lista) {
		this.lista = lista;
	}

	public abstract String salvar();
	public abstract String remover(T bean);
	public abstract String listar();
	
}
